//
//  FaceRegisterConfirmViewController.m
//  NuwaRobot
//
//  Created by Kendama on 2017/12/5.
//  Copyright © 2017年 Kendama. All rights reserved.
//

#import "FaceRegisterConfirmViewController.h"

@interface FaceRegisterConfirmViewController ()

/** 人脸识别图背景 **/
@property(nonatomic,strong) UIView *faceView;
@property(nonatomic,strong) UIImageView *faceImageView;
@property(nonatomic,strong) UIButton *cancelButton;
@property(nonatomic,strong) UIButton *confirmButton;

@end

@implementation FaceRegisterConfirmViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}


#pragma mark --- 点击事件
- (void)didClickConfirmButton
{
    
}

- (void)didClickCancelButton
{
    
}

#pragma mark --- 懒加载
- (UIView *)faceView
{
    if(!_faceView)
    {
        UIView *superView = self.view;
        _faceView = [[UIView alloc]init];
        [superView addSubview:_faceView];
        _faceView.backgroundColor = rgba(27,44,81,1);
    }
    return _faceView;
}
- (UIImageView *)faceImageView
{
    if(!_faceImageView)
    {
        UIView *superView = self.view;
        _faceImageView = [[UIImageView alloc]init];
        [superView addSubview:_faceImageView];
        _faceImageView.image = [UIImage imageNamed:@"pic1"];
    }
    return _faceImageView;
}

- (UIButton *)cancelButton
{
    if(!_cancelButton)
    {
        UIView *superView = self.view;
        _cancelButton = [[UIButton alloc]init];
        [superView addSubview:_cancelButton];
        [_cancelButton setTitle:@"取消" forState:UIControlStateNormal];
        [_cancelButton setTitleColor:rgba(143,157,189,1) forState:UIControlStateNormal];
        [_cancelButton.titleLabel setFont:fontCommonSize];
        _cancelButton.layer.masksToBounds = YES;
        _cancelButton.layer.cornerRadius = 1;
        _cancelButton.layer.borderColor = rgba(143,157,189,1).CGColor;
        [_cancelButton.layer setBorderWidth:.5];
        [_cancelButton addTarget:self action:@selector(didClickCancelButton) forControlEvents:UIControlEventTouchUpInside];
    }
    return _cancelButton;
}

- (UIButton *)confirmButton
{
    if(!_confirmButton)
    {
        UIView *superView = self.view;
        _confirmButton = [[UIButton alloc]init];
        [superView addSubview:_confirmButton];
        [_confirmButton setTitle:@"确定" forState:UIControlStateNormal];
        [_confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_confirmButton.titleLabel setFont:fontCommonSize];
        [_confirmButton setBackgroundColor:rgba(0,159,236,1)];
        _confirmButton.layer.cornerRadius = 2;
        [_confirmButton addTarget:self action:@selector(didClickConfirmButton) forControlEvents:UIControlEventTouchUpInside];
    }
    return _confirmButton;
}


- (void)masLayoutSubview
{
    __weak UIView *superView = self.view;
    [self.faceView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(superView.mas_top).with.offset(px1920Height(253));
        make.centerX.mas_equalTo(superView.mas_centerX);
        make.width.mas_equalTo(px1920Height(1000));
        make.height.mas_equalTo(px1920Height(1070));
    }];
    
    [self.faceImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.faceView.mas_top).with.offset(px1920Height(100));
        make.centerX.mas_equalTo(superView.mas_centerX);
        make.width.height.mas_equalTo(px1920Height(600));
    }];
    
    [self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.faceImageView.mas_bottom).with.offset(px1920Height(162));
        make.left.mas_equalTo(self.faceView.mas_left).with.offset(px1080Width(78));
        make.height.mas_equalTo(px1920Height(113));
        make.width.mas_equalTo(px1080Width(318));
    }];
    
    [self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.faceImageView.mas_bottom).with.offset(px1920Height(162));
        make.right.mas_equalTo(self.faceView.mas_right).with.offset(-px1080Width(78));
        make.height.mas_equalTo(px1920Height(113));
        make.width.mas_equalTo(px1080Width(318));
    }];
}


- (void)setNavigationStyle
{
    [self setNavigationBarTitle:@"人脸识别"];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
